<?php
if(!$_SESSION['memberID']){exit("<script>alert('登录超时或未登陆！');window.location='dlogin.html'</script>");}
include_once '/var/www/html/new/com.inc.php';
$ac=$GLOBALS['_ac'];
$pw=$GLOBALS['_pw'];
$s= new SoapClient(null,array("location" => "http://localhost/open/openService/pft_insideMX.php","uri" => "www.16u.com?ac_16u=$ac|pw_16u=$pw|auth_16u=true"));

$did=$_REQUEST['did'];
$money=$_REQUEST["tmoney"];
$memo=$_REQUEST['beizhu'];
if($_SESSION['memberID']!=23444  && $_SESSION['sdtype']!=9&&$_SESSION['sid']!=1){
	echo "<script>alert('禁止使用该功能!');</script>";
	exit;
}
$time=time();

if($_SESSION['ltime']!=0){
    if($time-$_SESSION['ltime']<120&&$_SESSION['ldid']==$did){
        echo "<script>alert('您操作太频繁，请稍后再试');window.location='../offlineRecharge.html';</script>";
        exit;
    }else{
        $_SESSION['ltime']=$time;
        $_SESSION['ldid']=$did;
    }
}
$_SESSION['ltime']=$time;
$_SESSION['ldid']=$did;
if(($res=$s->PFT_Member_Fund_Modify((int)$did,(int)$_SESSION['memberID'],(abs($money)*100),($money>0?0:1),0,"",3,0,"",$memo))==100){
    $sel="select dname from pft_member where id=".$did." limit 1";
    $GLOBALS['le']->query($sel);
    $GLOBALS['le']->fetch_assoc();
    $ins="insert pft_d_operation_rec set fid=".$_SESSION['memberID'].",sid=".$_SESSION['sid'].",daction='为".$GLOBALS['le']->f("dname")."线下充值".$money."元',rectime=now()";
    $GLOBALS['le']->query($ins);
    echo "<script>alert('充值成功!');window.location='../offlineRecharge.html';</script>";
    exit;
}else{
    echo "<script>alert('充值出错:".$res."');</script>";
    exit;
}




?>